package com.dfl.gankio.extend

import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProviders
import com.dfl.gankio.ViewModelFactory
import com.dfl.gankio.base.BaseApplication

fun <T : ViewModel> Fragment.obtainViewModel(viewModelClass: Class<T>) =
    ViewModelProviders.of(this, ViewModelFactory.newInstance()).get(viewModelClass)
